<template>
  <div style="height: 100vh; display: flex; align-items: center; justify-content: center; background-color: #69b6e0"><!--align-items: center;居中、、justify-content: center;水平居中-->
    <div style="display: flex; background-color: white; width: 80%;  border-radius: 5px;">
      <div style="flex: 1;display: flex;align-items: center;"><!--把上一行的div拆分为俩个部分，左右各一个-->
        <img src="@/assets/work2.png" alt="" style="width: 100%;height: 100%;">
      </div>
      <div style="flex: 1;display: flex; align-items: center; justify-content: center">
        <el-form :model="user" style="width: 80% " :rules="rules"><!-- // rules表单提示必须输入账号或者密码 -->
          <div style="font-size: 20px; font-weight: bold; text-align: center; margin-bottom: 20px">欢迎注册后台管理系统</div>
          <el-form-item prop="username">
            <el-input prefix-icon="el-icon-user" placeholder="请输入账号" v-model="user.username"></el-input>
          </el-form-item>
          <el-form-item prop="password">
            <el-input prefix-icon="el-icon-lock" show-password placeholder="请输入密码" v-model="user.password"></el-input>
          </el-form-item>
          <el-form-item prop="confirmPass">
            <el-input prefix-icon="el-icon-lock" show-password placeholder="请确认密码" v-model="user.confirmPass"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" style="width: 100%;" @click="login()">注册</el-button>
          </el-form-item>
          <div style="display: flex">
<!--            <div style="flex: 1">还没有账号?请<span style="color: #0f9876; cursor:pointer">注册</span></div>-->
            <div style="flex: 1; text-align: right"><span style="color:#0f9876; cursor:pointer">忘记密码</span></div>
          </div>

        </el-form>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "register",

  data() {
    return{
      user: {
        username: '',
        password: '',
        confirmPass : '',
      },
      rules :{//表单提示必须输入账号或者密码
        username: [
          { required:true, message:'请输入账号', trigger:'blur'},
        ],
        password : [
          { required:true, message:'请输入密码', trigger:'blur'},
        ],
        confirmPass : [
          { required:true, message:'请确认密码', trigger:'blur'},
        ]
      },

    }

  },
  methods: {
    login(){
      console.log(""+1)
    }
  }
}
</script>

<style>

</style>
